package org.jeecg.modules.xxgx.fjys.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.common.util.LoginUserUtil;
import org.jeecg.modules.xxgx.fjys.entity.CsXxCjmb;
import org.jeecg.modules.xxgx.fjys.entity.CsXxFjys;
import org.jeecg.modules.xxgx.fjys.service.ICsXxFjysService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @Description: 附加要素
* @Author: jeecg-boot
* @Date:   2023-10-09
* @Version: V1.0
*/
@Api(tags="附加要素")
@RestController
@RequestMapping("/xxgx/fjys/csXxFjys")
@Slf4j
public class CsXxFjysKzController extends JeecgController<CsXxFjys, ICsXxFjysService> {
   @Autowired
   private ICsXxFjysService csXxFjysService;

    /**
     * 取当前用户附加要素
     * @param csXxCjmb
     * @param req
     * @return
     */
    @ApiOperation(value="场景模板-取当前用户附加要素", notes="场景模板-取当前用户附加要素")
    @GetMapping(value = "/queryListByCurUser")
    public Result<List<CsXxFjys>> queryListByCurUser(CsXxCjmb csXxCjmb,
                                                       HttpServletRequest req) {
        String companyId = LoginUserUtil.getLoginUser().getCompanyId();
        List<CsXxFjys> csXxFjysList = csXxFjysService.lambdaQuery().eq(CsXxFjys::getCompanyId, companyId).list();

        return Result.OK(csXxFjysList);
    }
}
